s = input()
condition1 = len(s) >= 8
condition2 = all(c.isalnum() for c in s)
condition3 = any(c.isupper() for c in s) and any(c.isdigit() for c in s)

if condition1 and condition2 and condition3:
    print(0)
else:
    results = []
    if not condition1:
        results.append(1)
    if not condition2:
        results.append(2)
    if not condition3:
        results.append(3)
    results.sort()
    for result in results:
        print(result)